/**
 * 
 */
//GameId
var _gameNumber;
//Game Object
var _game;
//All the shots into it, will be played throug while replay
var _replayArray = [];
//Which player shot was last added to replay Array 0 - me, 1 - opponent
var _player;

function initGameNumber()
//Gives ID to game and creates game
{
	if (localStorage.gameNumber)
	{
		_gameNumber = parseInt(localStorage.gameNumber)+1;
	}
	else
	{
		_gameNumber = 1;
	}
	localStorage.gameNumber = String(_gameNumber);
	_game = new Object();
}
function addMyShipPlacement(shipPlacement)
//Adds shiplacement hash to game
{
	_game.myShipPlacement=shipPlacement;
}
function addShotsToStorage(player,shot,hit,drowned)
{
	_replayArray.push([player,shot,hit,drowned]);
}
function putGameLocalStorage ()
// adds game to localStorage
{
	_game.replayArray=_replayArray;
	localStorage.setItem(String(_gameNumber),JSON.stringify(_game));
}




